package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IStrategyCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("strategyComment")
public class StrategyCommentController {

    @Autowired
    private IStrategyCommentService strategyCommentService;

    @RequestMapping("list")
    public String query(@ModelAttribute("qo")QueryObject qo, Model model){
        model.addAttribute("pageInfo",strategyCommentService.query(qo));
        return "strategy/comment";
    }

    @RequestMapping("update")
    public String update(StrategyComment strategyComment){
        strategyCommentService.update(strategyComment);
        return "redirect:/strategyComment/list.do";
    }
}
